package com.ea.eadp.nexus.test.workflow.newconsole.parentemail;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.testng.Assert;

import com.ea.eadp.nexus.test.workflow.WorkflowElementArgument;

/**
 * Created with IntelliJ IDEA.
 * User: yjtao
 * Date: 12/24/14
 * Time: 2:49 PM
 * To change this template use File | Settings | File Templates.
 */
public class ResendEmailWorkflowElement
extends ParentEmailChallengeWorkflowElement {

    public ResendEmailWorkflowElement(
            WebDriver driver, WorkflowElementArgument argument
    ) {
        super(driver, argument);
    }

    @Override
    public void doAction() {
        page.sendControllerKey('X');
    }

    @Override
    public void doVerification() {
        Assert.assertEquals(
            page.getElementString(By.xpath("//div[@id='modal']/div[1]/div[1]/p")),
            "A Parent verification email has been sent to " + args.email + ".",
            "resend email page wrong"
        );
    }
    
    @Override
    public void moveNext() {
        page.sendControllerKey('B');
    }
}
